﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Diagnostics;
using KZ400B;

namespace KZ400BApp
{
    
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private void Application_Exit(object sender, ExitEventArgs e)
        {
            try
            {
                KZ400B.Controls.StateMsgManager.Stop();
                KZ400B.Controls.OneStepAddManager.Stop();
                AxleManager.Close();
                PositionCacheManager.SimulatorStop();
            }
            catch (Exception ex)
            {
                try
                {
                    Utility.FileOperate.WriteToLog("Application_Exit ex:{0}", ex.Message);
                    Process.GetCurrentProcess().Kill();
                }
                catch (Exception ex2)
                {
                    Utility.FileOperate.WriteToLog("Application_Exit ex2:{0}",ex2.Message);
                }
            }
        }
    }
}
